import request from '@/utils/request'
//采集任务管理接口
export function spiderTaskQuery(data) {
  //分页列表
  return request({
    method: 'get',
    url: '/openApi/spiderTask/query',
    params: data,
  })
}

export function spiderTaskQueryById(id) {
  //查询
  return request({
    method: 'get',
    url: '/openApi/spiderTask/query/' + id,
  })
}

export function spiderTaskAdd(data) {
  //添加
  return request({
    method: 'post',
    url: '/openApi/spiderTask/add',
    data,
  })
}

export function spiderTaskDelete(id) {
  //删除
  return request({
    method: 'get',
    url: '/openApi/spiderTask/delete/' + id,
  })
}

export function spiderTaskUpdate(data) {
  //修改
  return request({
    method: 'post',
    url: '/openApi/spiderTask/update',
    data,
  })
}

export function spiderTaskAddPlan(data) {
  //添加采集计划
  return request({
    method: 'post',
    url: '/openApi/spiderTask/addPlan',
    data,
  })
}

export function spiderTaskRun(id) {
  //执行采集
  return request({
    method: 'get',
    url: '/openApi/spiderTask/run/' + id,
  })
}

export function spiderTaskStart(id) {
  //启动定时任务
  return request({
    method: 'get',
    url: '/openApi/spiderTask/start/' + id,
  })
}

export function spiderTaskStop(id) {
  //停止定时任务
  return request({
    method: 'get',
    url: '/openApi/spiderTask/stop/' + id,
  })
}
